﻿using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.ComponentModel;

namespace InfFront.UICore
{
    /// <summary>
    /// Arguments for the IInfoEntries.GetData method
    /// </summary>
    public class InfoEntriesGetDataArgs : IInfoEntriesGetDataArgs
    {
        /// <summary>
        /// Starting bookmark
        /// </summary>
        public IInfoEntry Begin { get; set; }

        /// <summary>
        /// Finishing bookmark
        /// </summary>
        public IInfoEntry End { get; set; }

        /// <summary>
        /// requested fields descriptors
        /// </summary>
        public string[] FieldNames { get; set; }

        #region IInfoSourceGetDataArgs Members

        IInfoEntry IInfoEntriesGetDataArgs.GetBegin()
        {
            return Begin;
        }

        IInfoEntry IInfoEntriesGetDataArgs.GetEnd()
        {
            return End;
        }

        string[] IInfoEntriesGetDataArgs.GetFieldNames()
        {
            return FieldNames;
        }

        #endregion
    }

    /// <summary>
    /// Arguments of the IInfoSource.SetCallbacks member
    /// </summary>
    public class InfoSourceSetCallbacksArgs : IInfoSourceSetCallbacksArgs
    {
        /// <summary>
        /// What to do during the SetCallbacks call
        /// </summary>
        public SourceSetCallbacksActionKind Action { get; set; }

        /// <summary>
        /// callback to be added or removed
        /// </summary>
        public IInfoSourceCallbacks Callbacks { get; set; }

        #region IInfoSourceSetCallbacksArgs Members

        SourceSetCallbacksActionKind IInfoSourceSetCallbacksArgs.GetAction()
        {
            return Action;
        }

        IInfoSourceCallbacks IInfoSourceSetCallbacksArgs.GetCallbacks()
        {
            return Callbacks;
        }

        #endregion
    }

    /// <summary>
    /// IInfoCommand.GetIcon function parameters
    /// </summary>
    public class InfoCommandGetIconArgs: IInfoCommandGetIconArgs
    {
        /// <summary>
        /// Icon horizontal size (16, 24, 32, 72, 128 or other)
        /// </summary>
        public int HSize { get; set; }

        /// <summary>
        /// Icon vertical size (16, 24, 32, 72, 128 or other)
        /// </summary>
        public int VSize { get; set; }

        /// <summary>
        /// Style of the icon
        /// </summary>
        public IconStyle Style { get; set; }

        #region IInfoCommandGetIconArgs Members

        int IInfoCommandGetIconArgs.GetHSize()
        {
            return HSize;
        }

        int IInfoCommandGetIconArgs.GetVSize()
        {
            return VSize;
        }

        IconStyle IInfoCommandGetIconArgs.GetStyle()
        {
            return Style;
        }
        #endregion
    }

    /// <summary>
    /// Arguments of the IInfoSource.ExecuteCommand member
    /// </summary>
    public class ExecuteCommandArgs : IExecuteCommandArgs
    {
        /// <summary>
        /// The Command to be executed
        /// </summary>
        public IInfoCommand Command { get; set; }

        /// <summary>
        /// The entry to be executed on
        /// </summary>
        public IInfoEntry CurrentEntry { get; set; }

        #region IExecuteCommandArgs Members

        IInfoCommand IExecuteCommandArgs.GetCommand()
        {
            return Command;
        }

        IInfoEntry IExecuteCommandArgs.GetCurrentEntry()
        {
            return CurrentEntry;
        }

        #endregion
    }

    /// <summary>
    /// IInfoField enumeration items
    /// </summary>
    public class InfoFieldEnumItem: IInfoFieldEnumItem
    {
        public object Value { get; set; }
        public string Title { get; set; }

        #region IInfoFieldEnumItem Members

        string IInfoFieldEnumItem.GetTitle()
        {
            return Title;
        }

        object IInfoFieldEnumItem.GetValue()
        {
            return Value;
        }

        public override string ToString()
        {
            return Title;
        }

        #endregion
    }
}